package com.example.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

@Configuration
public class AppConfig {

    @Bean(name = "threadPoolExecutor")
    public ExecutorService threadPoolExecutor() {
        // 创建线程池
        return Executors.newFixedThreadPool(5);
    }
}